home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Turnbull China Bikeride
/
Turnbull China Bikeride - Disc 2.iso
/
STUTTGART
/
LANG
/
C
/
LIB
/
DESK
/
CORE
/
Desk
/
h_doc
/
SWI
< prev
next >
Wrap
Text File
|
1996-06-26
|
16KB
|
326 lines
/*
#### # # # #
# # # # # The FreeWare C library for
# # ## ### # # # # ### RISC OS machines
# # # # # # # # # # # ___________________________________
# # #### ### ## # # # #
# # # # # # # # # # Please refer to the accompanying
#### ### #### # # ##### # ### documentation for conditions of use
________________________________________________________________________
File: SWI.h
Author: Copyright © 1992 Jason Williams
Version: 1.02 (30 May 1994)
Purpose: Generic SWI call veneer function
*/
#ifndef __Desk_SWI_h
#define __Desk_SWI_h
#ifdef __cplusplus
extern "C" {
#endif
#ifndef __Desk_Core_h
#include "Desk.Core.h"
#endif
Desk_os_error *Desk_SWI(int numregsin, int numregsout, int swicode, ... );
/*
* This function provides a general-purpose SWI call veneer.
* It is not meant to be the most efficient SWI caller, but the most
* general one. If you require faster SWI handling than this function
* provides, then you will need to construct an assembler veneer for the SWI
* (see WimpSWIs library source for examples)
*
* Call it specifying the number of arguments you are passing in,
* the number of arguments you want passed back,
* the SWI number to call (X or normal),
* and a list of parameters...
* Parameters:
* The SWI list in should be a list of integers, exactly the number
* specified as "numregsin". These will be passed to the SWI as registers
* 0, 1, 2, ... A maximum of 6 such registers can be specified.
*
* The SWI list out should be a list of pointers to result variables
* they will be assigned the register results from the SWI, in order.
* Pass in a NULL pointer for any of these if the result is to be ignored
*
* Examples:
* SWI(0, 0, Desk_SWI_Hourglass_On);
* SWI(1, 0, Desk_SWI_Hourglass_Percentage, 33);
* SWI(0, 0, Desk_SWI_Hourglass_Smash | Desk_XOS_Bit); // To call Desk_XHourglass_Smash
*
* { int ramsprites, romsprites;
* \* Read rom sprite and ram sprite pool base addresses: *\
* SWI(0, 2, Desk_SWI_Wimp_BaseOfSprites, &romsprites, &ramsprites)
*
* \* Read ram sprite base ONLY *\
* SWI(0, 2, Desk_SWI_Wimp_BaseOfSprites, NULL, &ramsprites)
* }
*
* -- See Hourglass.h for examples of how to make low-level SWI calls
* look nice in your calling code without the extra expense of another
* function call.
*/
/* A few useful SWI numbers... */
#define Desk_SWI_XOS_Bit 0x020000
#define Desk_XOS_Bit Desk_SWI_XOS_Bit
#define Desk_SWI_OS_WriteI 0x000100
#define Desk_SWI_OS_WriteC 0x000000
#define Desk_SWI_OS_WriteS 0x000001
#define Desk_SWI_OS_Write0 0x000002
#define Desk_SWI_OS_NewLine 0x000003
#define Desk_SWI_OS_ReadC 0x000004
#define Desk_SWI_OS_CLI 0x000005
#define Desk_SWI_OS_Byte 0x000006
#define Desk_SWI_OS_Word 0x000007
#define Desk_SWI_OS_File 0x000008
#define Desk_SWI_OS_Args 0x000009
#define Desk_SWI_OS_BGet 0x00000a
#define Desk_SWI_OS_BPut 0x00000b
#define Desk_SWI_OS_GBPB 0x00000c
#define Desk_SWI_OS_Find 0x00000d
#define Desk_SWI_OS_ReadLine 0x00000e
#define Desk_SWI_OS_Control 0x00000f
#define Desk_SWI_OS_GetEnv 0x000010
#define Desk_SWI_OS_Exit 0x000011
#define Desk_SWI_OS_SetEnv 0x000012
#define Desk_SWI_OS_IntOn 0x000013
#define Desk_SWI_OS_IntOff 0x000014
#define Desk_SWI_OS_CallBack 0x000015
#define Desk_SWI_OS_EnterOS 0x000016
#define Desk_SWI_OS_BreakPt 0x000017
#define Desk_SWI_OS_BreakCtrl 0x000018
#define Desk_SWI_OS_UnusedSWI 0x000019
#define Desk_SWI_OS_UpdateMEMC 0x00001a
#define Desk_SWI_OS_SetCallBack 0x00001b
#define Desk_SWI_OS_Mouse 0x00001c
#define Desk_SWI_OS_Heap 0x00001d
#define Desk_SWI_OS_Module 0x00001e
#define Desk_SWI_OS_Claim 0x00001f
#define Desk_SWI_OS_Release 0x000020
#define Desk_SWI_OS_ReadUnsigned 0x000021
#define Desk_SWI_OS_GenerateEvent 0x000022
#define Desk_SWI_OS_ReadVarVal 0x000023
#define Desk_SWI_OS_SetVarVal 0x000024
#define Desk_SWI_OS_GSInit 0x000025
#define Desk_SWI_OS_GSRead 0x000026
#define Desk_SWI_OS_GSTrans 0x000027
#define Desk_SWI_OS_BinaryToDecimal 0x000028
#define Desk_SWI_OS_FSControl 0x000029
#define Desk_SWI_OS_ChangeDynamicArea 0x00002a
#define Desk_SWI_OS_GenerateError 0x00002b
#define Desk_SWI_OS_ReadEscapeState 0x00002c
#define Desk_SWI_OS_EvaluateExpression 0x00002d
#define Desk_SWI_OS_SpriteOp 0x00002e
#define Desk_SWI_OS_ReadPalette 0x00002f
#define Desk_SWI_OS_ServiceCall 0x000030
#define Desk_SWI_OS_ReadVduVariables 0x000031
#define Desk_SWI_OS_ReadPoint 0x000032
#define Desk_SWI_OS_UpCall 0x000033
#define Desk_SWI_OS_CallAVector 0x000034
#define Desk_SWI_OS_ReadModeVariable 0x000035
#define Desk_SWI_OS_RemoveCursors 0x000036
#define Desk_SWI_OS_RestoreCursors 0x000037
#define Desk_SWI_OS_SWINumberToString 0x000038
#define Desk_SWI_OS_SWINumberFromString 0x000039
#define Desk_SWI_OS_ValidateAddress 0x00003a
#define Desk_SWI_OS_CallAfter 0x00003b
#define Desk_SWI_OS_CallEvery 0x00003c
#define Desk_SWI_OS_RemoveTickerEvent 0x00003d
#define Desk_SWI_OS_InstallKeyHandler 0x00003e
#define Desk_SWI_OS_CheckModeValid 0x00003f
#define Desk_SWI_OS_ChangeEnvironment 0x000040
#define Desk_SWI_OS_ClaimScreenMemory 0x000041
#define Desk_SWI_OS_ReadMonotonicTime 0x000042
#define Desk_SWI_OS_SubstituteArgs 0x000043
#define Desk_SWI_OS_PrettyPrint 0x000044
#define Desk_SWI_OS_Plot 0x000045
#define Desk_SWI_OS_WriteN 0x000046
#define Desk_SWI_OS_AddToVector 0x000047
#define Desk_SWI_OS_WriteEnv 0x000048
#define Desk_SWI_OS_ReadArgs 0x000049
#define Desk_SWI_OS_ReadRAMFsLimits 0x00004a
#define Desk_SWI_OS_ClaimDeviceVector 0x00004b
#define Desk_SWI_OS_ReleaseDeviceVector 0x00004c
#define Desk_SWI_OS_DelinkApplication 0x00004d
#define Desk_SWI_OS_RelinkApplication 0x00004e
#define Desk_SWI_OS_HeapSort 0x00004f
#define Desk_SWI_OS_ExitAndDie 0x000050
#define Desk_SWI_OS_ReadMemMapInfo 0x000051
#define Desk_SWI_OS_ReadMemMapEntries 0x000052
#define Desk_SWI_OS_SetMemMapEntries 0x000053
#define Desk_SWI_OS_AddCallBack 0x000054
#define Desk_SWI_OS_ReadDefaultHandler 0x000055
#define Desk_SWI_OS_SetECFOrigin 0x000056
#define Desk_SWI_OS_SerialOp 0x000057
#define Desk_SWI_OS_ReadSysInfo 0x000058
#define Desk_SWI_OS_Confirm 0x000059
#define Desk_SWI_OS_ChangedBox 0x00005a
#define Desk_SWI_OS_CRC 0x00005b
#define Desk_SWI_OS_ReadDynamicArea 0x00005c
#define Desk_SWI_OS_PrintChar 0x00005d
#define Desk_SWI_OS_ConvertStandardDateAndTime 0x0000c0
#define Desk_SWI_OS_ConvertDateAndTime 0x0000c1
#define Desk_SWI_OS_ConvertHex1 0x0000d0
#define Desk_SWI_OS_ConvertHex2 0x0000d1
#define Desk_SWI_OS_ConvertHex4 0x0000d2
#define Desk_SWI_OS_ConvertHex6 0x0000d3
#define Desk_SWI_OS_ConvertHex8 0x0000d4
#define Desk_SWI_OS_ConvertCardinal1 0x0000d5
#define Desk_SWI_OS_ConvertCardinal2 0x0000d6
#define Desk_SWI_OS_ConvertCardinal3 0x0000d7
#define Desk_SWI_OS_ConvertCardinal4 0x0000d8
#define Desk_SWI_OS_ConvertInteger1 0x0000d9
#define Desk_SWI_OS_ConvertInteger2 0x0000da
#define Desk_SWI_OS_ConvertInteger3 0x0000db
#define Desk_SWI_OS_ConvertInteger4 0x0000dc
#define Desk_SWI_OS_ConvertBinary1 0x0000dd
#define Desk_SWI_OS_ConvertBinary2 0x0000de
#define Desk_SWI_OS_ConvertBinary3 0x0000df
#define Desk_SWI_OS_ConvertBinary4 0x0000e0
#define Desk_SWI_OS_ConvertSpacedCardinal1 0x0000e1
#define Desk_SWI_OS_ConvertSpacedCardinal2 0x0000e2
#define Desk_SWI_OS_ConvertSpacedCardinal3 0x0000e3
#define Desk_SWI_OS_ConvertSpacedCardinal4 0x0000e4
#define Desk_SWI_OS_ConvertSpacedInteger1 0x0000e5
#define Desk_SWI_OS_ConvertSpacedInteger2 0x0000e6
#define Desk_SWI_OS_ConvertSpacedInteger3 0x0000e7
#define Desk_SWI_OS_ConvertSpacedInteger4 0x0000e8
#define Desk_SWI_OS_ConvertFixedNetStation 0x0000e9
#define Desk_SWI_OS_ConvertNetStation 0x0000ea
#define Desk_SWI_OS_ConvertFixedFileSize 0x0000eb
#define Desk_SWI_OS_ConvertFileSize 0x0000ec
#define Desk_SWI_IIC_Control 0x000240
#define Desk_SWI_Econet_CreateReceive 0x040000
#define Desk_SWI_Econet_ExamineReceive 0x040001
#define Desk_SWI_Econet_ReadReceive 0x040002
#define Desk_SWI_Econet_AbandonReceive 0x040003
#define Desk_SWI_Econet_WaitForReception 0x040004
#define Desk_SWI_Econet_EnumerateReceive 0x040005
#define Desk_SWI_Econet_StartTransmit 0x040006
#define Desk_SWI_Econet_PollTransmit 0x040007
#define Desk_SWI_Econet_AbandonTransmit 0x040008
#define Desk_SWI_Econet_DoTransmit 0x040009
#define Desk_SWI_Econet_ReadLocalStationAndNet 0x04000a
#define Desk_SWI_Econet_ConvertStatusTOString 0x04000b
#define Desk_SWI_Econet_ConvertStatusToError 0x04000c
#define Desk_SWI_Econet_ReadProtection 0x04000d
#define Desk_SWI_Econet_SetProtection 0x04000e
#define Desk_SWI_Econet_ReadStationNumber 0x04000f
#define Desk_SWI_Econet_PrintBanner 0x040010
#define Desk_SWI_Econet_ReleasePort 0x040012
#define Desk_SWI_Econet_AllocatePort 0x040013
#define Desk_SWI_Econet_DeAllocatePort 0x040014
#define Desk_SWI_Econet_ClaimPort 0x040015
#define Desk_SWI_Econet_StartImmediate 0x040016
#define Desk_SWI_Econet_DoImmediate 0x040017
#define Desk_SWI_NetFS_ReadFSNumber 0x040040
#define Desk_SWI_NetFS_SetFSNumber 0x040041
#define Desk_SWI_NetFS_ReadFSName 0x040042
#define Desk_SWI_NetFS_SetFSName 0x040043
#define Desk_SWI_NetFS_ReadCurrentContext 0x040044
#define Desk_SWI_NetFS_SetCurrentContext 0x040045
#define Desk_SWI_NetFS_ReadFSTimeouts 0x040046
#define Desk_SWI_NetFS_SetFSTimeouts 0x040047
#define Desk_SWI_NetFS_DoFSOp 0x040048
#define Desk_SWI_NetFS_EnumerateFSList 0x040049
#define Desk_SWI_NetFS_EnumerateFS 0x04004a
#define Desk_SWI_NetFS_ConvertDate 0x04004b
#define Desk_SWI_NetFS_DoFSOpToGivenFS 0x04004c
#define Desk_SWI_Sound_Configure 0x040140
#define Desk_SWI_Sound_Enable 0x040141
#define Desk_SWI_Sound_Stereo 0x040142
#define Desk_SWI_Sound_Speaker 0x040143
#define Desk_SWI_Sound_Volume 0x040180
#define Desk_SWI_Sound_SoundLog 0x040181
#define Desk_SWI_Sound_LogScale 0x040182
#define Desk_SWI_Sound_InstallVoice 0x040183
#define Desk_SWI_Sound_RemoveVoice 0x040184
#define Desk_SWI_Sound_AttachVoice 0x040185
#define Desk_SWI_Sound_ControlPacked 0x040186
#define Desk_SWI_Sound_Tuning 0x040187
#define Desk_SWI_Sound_Pitch 0x040188
#define Desk_SWI_Sound_Control 0x040189
#define Desk_SWI_Sound_AttachNamedVoice 0x04018a
#define Desk_SWI_Sound_ReadControlBlock 0x04018b
#define Desk_SWI_Sound_WriteControlBlock 0x04018c
#define Desk_SWI_Sound_QInit 0x0401c0
#define Desk_SWI_Sound_QSchedule 0x0401c1
#define Desk_SWI_Sound_QRemove 0x0401c2
#define Desk_SWI_Sound_QFree 0x0401c3
#define Desk_SWI_Sound_QSDispatch 0x0401c4
#define Desk_SWI_Sound_QTempo 0x0401c5
#define Desk_SWI_Sound_QBeat 0x0401c6
#define Desk_SWI_Sound_QInterface 0x0401c7
#define Desk_SWI_NetPrint_ReadPSNumber 0x040200
#define Desk_SWI_NetPrint_SetPSNumber 0x040201
#define Desk_SWI_NetPrint_ReadPSName 0x040202
#define Desk_SWI_NetPrint_SetPSName 0x040203
#define Desk_SWI_NetPrint_ReadPSTimeouts 0x040204
#define Desk_SWI_NetPrint_SetPSTimeouts 0x040205
#define Desk_SWI_ADFS_DiscOp 0x040240
#define Desk_SWI_ADFS_HDC 0x040241
#define Desk_SWI_ADFS_Drives 0x040242
#define Desk_SWI_ADFS_FreeSpace 0x040243
#define Desk_SWI_ADFS_Retries 0x040244
#define Desk_SWI_ADFS_DescribeDisc 0x040245
#define Desk_SWI_Podule_ReadID 0x040280
#define Desk_SWI_Podule_ReadHeader 0x040281
#define Desk_SWI_Podule_EnumerateChunks 0x040282
#define Desk_SWI_Podule_ReadChunk 0x040283
#define Desk_SWI_Podule_ReadBytes 0x040284
#define Desk_SWI_Podule_WriteBytes 0x040285
#define Desk_SWI_Podule_CallLoader 0x040286
#define Desk_SWI_Podule_RawRead 0x040287
#define Desk_SWI_Podule_RawWrite 0x040288
#define Desk_SWI_Podule_HardwareAddress 0x040289
#define Desk_SWI_WaveSynth_Load 0x040300
#define Desk_SWI_Debugger_Disassemble 0x040380
#define Desk_SWI_FPEmulator_Version 0x040480
#define Desk_SWI_FileCore_DiscOp 0x040540
#define Desk_SWI_FileCore_Create 0x040541
#define Desk_SWI_FileCore_Drives 0x040542
#define Desk_SWI_FileCore_FreeSpace 0x040543
#define Desk_SWI_FileCore_FloppyStructure 0x040544
#define Desk_SWI_FileCore_DescribeDisc 0x040545
#define Desk_SWI_Shell_Create 0x0405c0
#define Desk_SWI_Shell_Destroy 0x0405c1
#define Desk_SWI_Draw_ProcessPath 0x040700
#define Desk_SWI_Draw_ProcessPathFP 0x040701
#define Desk_SWI_Draw_Fill 0x040702
#define Desk_SWI_Draw_FillFP 0x040703
#define Desk_SWI_Draw_Stroke 0x040704
#define Desk_SWI_Draw_StrokeFP 0x040705
#define Desk_SWI_Draw_StrokePath 0x040706
#define Desk_SWI_Draw_StrokePathFP 0x040707
#define Desk_SWI_Draw_FlattenPath 0x040708
#define Desk_SWI_Draw_FlattenPathFP 0x040709
#define Desk_SWI_Draw_TransformPath 0x04070a
#define Desk_SWI_Draw_TransformPathFP 0x04070b
#define Desk_SWI_RamFS_DiscOp 0x040780
#define Desk_SWI_RamFS_Drives 0x040782
#define Desk_SWI_RamFS_FreeSpace 0x040783
#define Desk_SWI_RamFS_DescribeDisc 0x040785
#ifdef __cplusplus
}
#endif
#endif